**# Bookmark #1 Setting

*Windows
global root  = "G:/Dropbox/Environmental Injustice/Empirical"
global rawdata = "$root/rawdata"
global workdata = "$root/workdata"
global results = "$root/results"
global outfile = "$root/outfile"

cd "$workdata"


**# Bookmark #2 Figure S3(A): Population Share of Rural Hukou Holders
*Firm-level COD Emission
use "$outfile/Firm_regression.dta",clear

forvalues i=2001/2010{
gen year`i'=(year==`i')
gen rural_Year`i'=rural*year`i'
}
	
reghdfe codemission rural_Year2001 rural_Year2002 rural_Year2003 rural_Year2004 o.rural_Year2005 rural_Year2006 rural_Year2007 rural_Year2008 rural_Year2009 rural_Year2010,absorb(i.id i.province#i.year) cluster(i.province i.year)
est store rural


coefplot rural, keep(rural_Year*) levels(95) omitted vertical ///
    xlabel(1 "2001" 2 "2002" 3 "2003" 4 "2004" 5 "2005" 6 "2006" 7 "2007" 8 "2008" 9 "2009" 10 "2010", ///
	labcolor(black)) ///
    recast(connected) lcolor(navy) lpattern(solid) lwidth(medthick) ///
    ciopts(recast(rcap) lcolor(%50) lwidth(thin)) ///
    mlcolor(navy) mfcolor(white) msize(medium) msymbol(oh) ///
	ylabel(-0.2(0.2)0.4,nogrid) ///
    yline(0, lcolor(gs10) lwidth(thin)) ///
    xline(5, lcolor(gs10) lpattern(dash)) ///
    ytitle("Coefficient") ///
	xtitle("(A) Population Share of Rural Hukou Holders",size(large) margin(l-10 t+4 b-4)) ///
	graphregion(lcolor(white) color(white)) ///
    plotregion(margin(zero) color(white))

graph export "$results/Fig. S3(A).pdf", as(pdf) name("Graph") replace


**# Bookmark #2 Figure S3(B): Population Share of Skilled Occupation
*Firm-level COD Emission
use "$outfile/Firm_regression.dta",clear

forvalues i=2001/2010{
gen year`i'=(year==`i')
gen occupation_Year`i'=occupation*year`i'
}
	
reghdfe codemission occupation_Year2001 occupation_Year2002 occupation_Year2003 occupation_Year2004 o.occupation_Year2005 occupation_Year2006 occupation_Year2007 occupation_Year2008 occupation_Year2009 occupation_Year2010,absorb(i.id i.province#i.year) cluster(i.province i.year)
est store occupation


coefplot occupation, keep(occupation_Year*) levels(95) omitted vertical ///
    xlabel(1 "2001" 2 "2002" 3 "2003" 4 "2004" 5 "2005" 6 "2006" 7 "2007" 8 "2008" 9 "2009" 10 "2010", ///
	labcolor(black)) ///
    recast(connected) lcolor(navy) lpattern(solid) lwidth(medthick) ///
    ciopts(recast(rcap) lcolor(%50) lwidth(thin)) ///
    mlcolor(navy) mfcolor(white) msize(medium) msymbol(oh) ///
    yline(0, lcolor(gs10) lwidth(thin)) ///
    xline(5, lcolor(gs10) lpattern(dash)) ///
	ylabel(-2(1)1,nogrid) ///
    ytitle("Coefficient", margin(zero)) ///
	xtitle("(B) Population Share of Skilled Occupation",size(large) margin(l-10 t+4 b-4)) ///
	graphregion(lcolor(white) color(white)) ///
    plotregion(margin(zero) color(white))

graph export "$results/Fig. S3(B).pdf", as(pdf) name("Graph") replace